Call Refresh API to satisfy ?refresh in Stateless#93160
Merged
pxsalehi merged 12 commits intoelastic:mainfrom Jan 24, 2023
Merged
Call Refresh API to satisfy ?refresh in Stateless#93160pxsalehi merged 12 commits intoelastic:mainfrom
?refresh in Stateless#93160pxsalehi merged 12 commits intoelastic:mainfrom
Conversation
DaveCTurner
reviewed
Jan 23, 2023
server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java
Outdated
Show resolved
Hide resolved
Contributor
|
The failure is #93142; @elasticmachine please run elasticsearch-ci/part-2 |
Member
Author
|
I'm writing a test with this on the Stateless module. It seems when it's |
pxsalehi
commented
Jan 24, 2023
| ActionListener<BulkResponse> listener = outerListener; | ||
| if (DiscoveryNode.isStateless(clusterService.getSettings()) && bulkRequest.getRefreshPolicy() != WriteRequest.RefreshPolicy.NONE) { | ||
| listener = outerListener.delegateFailure((l, r) -> { client.admin().indices().prepareRefresh().execute(l.map(ignored -> r)); }); | ||
| bulkRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.NONE); |
Member
Author
There was a problem hiding this comment.
I think for the WAIT_UNTIL to work properly, we'd need to also integrate the refresh listeners mechanism in Stateless, since currently they don't get called back. Since we're going with work-arounds here to keep it short, I've just replaced the policy once we know we're calling a refresh afterwards anyway.
Collaborator
|
Pinging @elastic/es-distributed (Team:Distributed) |
DaveCTurner
reviewed
Jan 24, 2023
server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
Outdated
Show resolved
Hide resolved
DaveCTurner
approved these changes
Jan 24, 2023
Contributor
DaveCTurner
left a comment
There was a problem hiding this comment.
LGTM apart from the spurious @AwaitsFix
Member
Author
|
Thanks, David! |
mark-vieira
pushed a commit
to mark-vieira/elasticsearch
that referenced
this pull request
Jan 31, 2023
…lastic#93383) In elastic#93160, we never set the forced_refresh flag in the response. With this change, the bulk response now correctly reflects what happened. It also unblocks a bunch of YAML tests for Stateless. Relates ES-5292
tlrx
added a commit
to tlrx/elasticsearch
that referenced
this pull request
Feb 1, 2023
tlrx
added a commit
that referenced
this pull request
Feb 1, 2023
Since we know which indices were involved in the Bulk request we can refresh only those instead of all indices, and expand to hidden indices so that they are also refreshed. Relates #93160
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a workaround that provides support for the
IMMEDIATEandWAIT_UNTILRefresh policies.Relates ES-5292